<?php
namespace app\api\controller\robat;

use app\api\controller\Base;

class Index extends Base
{
    public function index()
    {
        set_time_limit(1000);
        //预约提醒通知
        $Subscribe = new Subscribe;
        $sb[] = $Subscribe->index();

        //数企语音识别通知 -- 开启呼叫中心
        if(get_config_value('call_center_switch')==true){
            $Shuqi = new Shuqi;
            try {
                $sb[] = $Shuqi->call_did_sessionId();//did 转为 sessionId
            } catch (Exception $e) {
                dump($e);
            }
            try {
                $sb[] = $Shuqi->call_list_asr_phone();//语音转文字
            } catch (Exception $e) {
                dump($e);
            }
            try {
                $sb[] = $Shuqi->call_list_chat_summary();//文字转总结
            } catch (Exception $e) {
                dump($e);
            }
        }

        //云客数据更新-微信数据
        if(get_config_value('yunke_switch')==true){
            $yunke = new Yunke;
            try {
                $sb[] = $yunke->get_wechat_bussiness();//语音转文字
            } catch (Exception $e) {
                dump($e);
            }
            try {
                $sb[] = $yunke->get_wechat_customer();//文字转总结
            } catch (Exception $e) {
                dump($e);
            }
            try {
                $sb[] = $yunke->get_wechat_record();//文字转总结
            } catch (Exception $e) {
                dump($e);
            }
        }
        return myok($sb);
    }
}
